window: Only check for the event widget if clicked on the "content" region
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 2 Jun 2014 16:04:36 +0000 (18:04 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 2 Jun 2014 16:38:25 +0000 (18:38 +0200)
Every button press/release event reaching the the multipress gesture in GtkWindow
and happening in the "title" region must be handled, regardless of the event widget.
Children there wanting the event(s) for themselves are (and were always) expected
to stop event propagation.

So the only place to check for the event widget's "window-dragging" style property
is the "content" region, which matches the pre-gestures behavior.

This fixes some issues with sequences being mistakenly claimed (and events not
propagated further) on situations it shouldn't.

gtk/gtkwindow.c

index 604fecef132ed598e2e4bd5724fb1c161a816337..06c75926331566ce8f9a8f15b4b378854a79a8f9 100644 (file)
@@ -1435,15 +1435,15 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture,
       if (event_widget != widget)
         gtk_widget_style_get (event_widget, "window-dragging",
                               &window_drag, NULL);
-      /* fall thru */
-    case GTK_WINDOW_REGION_TITLE:
-      if (!window_drag && event_widget != widget)
+
+      if (!window_drag)
         {
           gtk_gesture_set_sequence_state (GTK_GESTURE (gesture),
                                           sequence, GTK_EVENT_SEQUENCE_DENIED);
           return;
         }
-
+      /* fall thru */
+    case GTK_WINDOW_REGION_TITLE:
       if (n_press == 2)
         _gtk_window_toggle_maximized (window);
       /* fall thru */